package com.jackeys.piaems.dao;

import com.jackeys.piaems.dto.PaymentDetailDto;
import com.jackeys.piaems.entity.Payment;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @InterfaceName: PaymentDao
 * @Description: 账单持久层接口
 * @Author: Jackeys
 * @Date: 2021-06-17 20:06
 * @Version: 1.0
 */
public interface PaymentDao {
    //添加账单
    Boolean insertPayment(Long userId, Long categoryId, Date date, Float cost, String remark, Integer flag);

    //删除账单
    Boolean deletePayment(Long id);

    //修改订单
    Boolean updatePayment(Long id, Long categoryId, Float cost, String remark, Integer flag);

    //根据日期查询某一日期下的所有账单记录
    List<PaymentDetailDto> selectPaymentsByDate(Long userId, Date date, Integer flag);

    //查询总支出与总收入
    Float selectInAndOutSum(Long userId, Integer flag);

    //查询总览的账单
    List<Payment> selectTotalPaymentList(Long userId, Integer start, Integer size, Integer flag);

    //查询总览的数量
    Integer selectCntByTotal(Long userId, Integer flag);

    //返回给前端图
    List<Payment> selectAllPayment(Long userId, Integer flag);

}
